package leetcode.backtrace;

import leetcode.backtrace.common.BackTraceUtils;
import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

import java.util.List;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution257 {
    public List<String> binaryTreePaths(TreeNode root) {
//        return TreeUtils.binaryTreePaths(root);
        // todo 二叉树的所有路径
        return BackTraceUtils.binaryTreePaths(root);
    }
}

public class leetcode257 {
    public static void main(String[] args) {
        Solution257 solution257 = new Solution257();
        Integer[] nums = {1,2,3,null,5};
        Integer[] nums1 = {1};
        System.out.println(solution257.binaryTreePaths(TreeUtils.generateLeetcodeTree(nums)));
        System.out.println(solution257.binaryTreePaths(TreeUtils.generateLeetcodeTree(nums1)));
    }
}
